int Count { get; set; }

robot_2Generated
code_blocksInput

Description

The Count property of the NetList<T> class provides the number of elements contained in the list. This property is useful for determining the size of the list at any given time.

Usage

To access the Count property, simply use the property on an instance of NetList<T>. This property is read-only and returns an integer representing the number of elements in the list.

Example

// Example of using the Count property
public class MyComponent : Component
{
    [Sync] public NetList<int> MyIntegerList { get; set; } = new();

    public void PrintCount()
    {
        int count = MyIntegerList.Count;
        // Use the count value as needed
    }
}